//******************************************************************************
// @File: cyzActionInitialization.cc
// @Author: Cyz
// @Date: 2020年 5月 1日 星期五 21时13分33秒 CST
// @Description: 
//		Implementation of the cyzActionInitialzation class
//		5-1: Particle Gun in PrimaryGenerationAction
//******************************************************************************
/// \file cyzActionInitialization.cc
/// \brief Implementation of the cyzActionInitialization class

#include "cyzActionInitialization.hh"
#include "cyzPrimaryGeneratorAction.hh"
#include "cyzRunAction.hh"
#include "cyzEventAction.hh"
#include "cyzSteppingAction.hh"

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

cyzActionInitialization::cyzActionInitialization(
		cyzDetectorConstruction* detector)
: G4VUserActionInitialization(),
	fDetectorConstruction(detector)
{}

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

cyzActionInitialization::~cyzActionInitialization()
{}

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
/**
 * @brief: 并行计算专用，我记得没必要
 */
/**
void cyzActionInitialization::BuildForMaster() const
{
  //cyzRunAction* runAction = new cyzRunAction;
  //SetUserAction(runAction);
}
*/

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

void cyzActionInitialization::Build() const
{
  SetUserAction(new cyzPrimaryGeneratorAction);

  SetUserAction(new cyzRunAction);
  
  cyzEventAction* eventAction = new cyzEventAction();
  SetUserAction(eventAction);
  
  SetUserAction(new cyzSteppingAction(eventAction, fDetectorConstruction));
}  

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
